package com.znyj.servlet.task;

import com.znyj.servlet.task.model.AbstractTaskModel;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * Created by gaoliwei on 15-3-3.
 */
abstract class AbstractTaskMapping<T extends AbstractTaskModel> {

    protected final Map<Long, T> taskMap = new ConcurrentHashMap<>();

    public void add(long openOrderId, T task) {
        taskMap.put(openOrderId, task);
    }

    public void remove(long openOrderId) {
        taskMap.remove(openOrderId);
    }

    public abstract void sendTasks();
}